<?php
error_reporting(E_ALL);
require_once "news/MyProxy.php";
require_once "news/MyNews.php";

$checkPermission = function (){
    echo "(判断用户权限)";
};
$checkLogin = function (){
    echo "(判断用户登录)";
};
$setLog = function (){
    echo "(记录执行日志)";
};

$proxy = new MyProxy(new MyNews());

$proxy->addPoint($checkLogin,PointCut::BEFORE);
$proxy->addPoint($checkPermission,PointCut::BEFORE);
$proxy->addPoint($setLog,PointCut::AFTER);

$proxy->editNews(123);